package com.zhengshang.api.service.impl;

import java.util.List;
import com.zhengshang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhengshang.api.mapper.AppAdvertisementRecordMapper;
import com.zhengshang.api.domain.AppAdvertisementRecord;
import com.zhengshang.api.service.IAppAdvertisementRecordService;

/**
 * APP用户观看广告记录Service业务层处理
 * 
 * @author zhengshang
 * @date 2021-04-14
 */
@Service
public class AppAdvertisementRecordServiceImpl implements IAppAdvertisementRecordService 
{
    @Autowired
    private AppAdvertisementRecordMapper appAdvertisementRecordMapper;

    /**
     * 查询APP用户观看广告记录
     * 
     * @param recordId APP用户观看广告记录ID
     * @return APP用户观看广告记录
     */
    @Override
    public AppAdvertisementRecord selectAppAdvertisementRecordById(Long recordId)
    {
        return appAdvertisementRecordMapper.selectAppAdvertisementRecordById(recordId);
    }

    @Override
    public AppAdvertisementRecord selectAppAdvertisementRecordByNum(String advertisementNum) {
        return appAdvertisementRecordMapper.selectAppAdvertisementRecordByNum(advertisementNum);
    }

    /**
     * 查询APP用户观看广告记录列表
     * 
     * @param appAdvertisementRecord APP用户观看广告记录
     * @return APP用户观看广告记录
     */
    @Override
    public List<AppAdvertisementRecord> selectAppAdvertisementRecordList(AppAdvertisementRecord appAdvertisementRecord)
    {
        return appAdvertisementRecordMapper.selectAppAdvertisementRecordList(appAdvertisementRecord);
    }

    /**
     * 新增APP用户观看广告记录
     * 
     * @param appAdvertisementRecord APP用户观看广告记录
     * @return 结果
     */
    @Override
    public int insertAppAdvertisementRecord(AppAdvertisementRecord appAdvertisementRecord)
    {
        return appAdvertisementRecordMapper.insertAppAdvertisementRecord(appAdvertisementRecord);
    }

    /**
     * 修改APP用户观看广告记录
     * 
     * @param appAdvertisementRecord APP用户观看广告记录
     * @return 结果
     */
    @Override
    public int updateAppAdvertisementRecord(AppAdvertisementRecord appAdvertisementRecord)
    {
        appAdvertisementRecord.setUpdateTime(DateUtils.getNowDate());
        return appAdvertisementRecordMapper.updateAppAdvertisementRecord(appAdvertisementRecord);
    }

    /**
     * 批量删除APP用户观看广告记录
     * 
     * @param recordIds 需要删除的APP用户观看广告记录ID
     * @return 结果
     */
    @Override
    public int deleteAppAdvertisementRecordByIds(Long[] recordIds)
    {
        return appAdvertisementRecordMapper.deleteAppAdvertisementRecordByIds(recordIds);
    }

    /**
     * 删除APP用户观看广告记录信息
     * 
     * @param recordId APP用户观看广告记录ID
     * @return 结果
     */
    @Override
    public int deleteAppAdvertisementRecordById(Long recordId)
    {
        return appAdvertisementRecordMapper.deleteAppAdvertisementRecordById(recordId);
    }

    @Override
    public int setInvalidData(AppAdvertisementRecord appAdvertisementRecord) {
        return appAdvertisementRecordMapper.setInvalidData(appAdvertisementRecord);
    }

    @Override
    public int getRecordNum(AppAdvertisementRecord appAdvertisementRecord) {
        return appAdvertisementRecordMapper.getRecordNum(appAdvertisementRecord);
    }
}
